package com.naiterui.ehp.bs.doctor.utils;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import com.naiterui.ehp.bp.constants.CommonConstant;
import com.naiterui.ehp.bp.utils.date.DateUtil;
import com.naiterui.ehp.bp.utils.lang.ConfigUtil;

/**
 * @Description 属性常量文件(公共属性)
 */
public abstract class PropertyValueConstants {

    public static final int UPGRADE_LEVEL_NONE = 0;
    public static final int UPGRADE_LEVEL_RECOMMEND = 1;
    public static final int UPGRADE_LEVEL_FORCE = 2;

    // 医生类型--正常医生
    public static final int DOCTOR_TYPE_NOMAL = 0;
    // 医生类型--测试医生
    public static final int DOCTOR_TYPE_TEST = 1;
    // 医生标签--普通医生
    public static final int DOCTOR_LABLE_NOMAL = 0;
    // 医生标签--种子医生
    public static final int DOCTOR_LABLE_SEED = 1;
    // 医生标签--乡村医生
    public static final int DOCTOR_LABEL_COUNTRY = 2;

    // 医生端平台常量
    public static final int PLATFORM_APP_H5 = 4;
    public static final int PLATFORM_APP_ANDROID = 0;
    public static final int PLATFORM_APP_IOS = 1;
    public static final int PLATFORM_WEIXIN = 3;
    // 临时添加2.6.0之前的版本中ios使用header的_p为2
    public static final int PLIATFORM_APP_IOS_TEMP = 2;
    // 全国区域
    public static final int WHOLE_COUNTRY_AREA = 0;
    // 递归获取城市上一级id次数
    public static final int RECURSION_COUNT = 5;
    // 循环次数用完
    public static final Integer RUN_OUT_OF_TIME = 0;
    // 医生端注册来源常量
    public static final int REGIST_PLATFORM_APP = 0;
    public static final int REGIST_PLATFORM_WX = 1;
    // 医生微信注册标识
    public static final String REGIST_WX_PRE = CommonConstant.REDIS_PRE_DR + "reg_wx_";

    /**
     * 登录失败次数
     */
    public static final int LOGIN_FAIL_COUNT = 5;

    /**
     * 登录失败
     */
    public static final int LOGIN_FAIL_LOCK_TIME = 30 * 60;

    // 验证码有效期
    public static final int SAVE_VERIFY_CODE = 10 * 60;
    // 发送验证码
    public static final int MINTER = 60;
    // 短信发送间隔时间
    public static final int SEND_SPACE = 55;
    // 验证码发送次数限制
    public static final int SEND_MAX_COUNT = 10;
    // 医生信息默认缓存4个小时
    public static final int DOCTOR_CACHE_DATE = 4 * 60 * 60;

    // 手机号长度
    public static final int PHONE_NUM_LENGTH = 11;

    // 区域定价医生区域默认缓存6小时
    public static final int DOCTOR_AREA_EXPIRE = 6 * 60 * 60;

    // 四川监管access_token默认有效期
    public static final int SUPER_ACCESS_TOKEN_EXPIRE = 6 * 60 * 60;
    /**
     * version字段的默认值
     */
    public static final short DEFAULT_VERSION = 0;

    /**
     * 附件文件夹
     */
    public static final String ATTCHMENT_POSITON = "/attchment";

    /**
     * 邀请类型-医生-->医生
     */
    public static final int INVTEE_TYPE_DOCTOR = 1;
    /**
     * 邀请类型-商务代表-->医生
     */
    public static final int INVTEE_TYPE_BUSINESS = 0;

    /**
     * 合作商-互联网医院
     */
    public static final long ASCRIPTION_TYPE_NAITERUI = 4;
    /**
     * 合作商-步长
     */
    public static final long ASCRIPTION_TYPE_BUCHANG = 1;

    /**
     * 默认合作商名
     */
    public static final String DEF_ASCRIPTION_NAME = ConfigUtil.getString("ehp.hospital.name");

    /**
     * 医生账户禁用状态
     */
    public static final int DOCTOR_ACCOUNT_STATUS_DISABLE = 1;

    /**
     * 推荐用药试用次数
     */
    public static final int MEDIC_RECOM_TRIAL_TIMES = 3;

    /**
     * 订单回调状态-成功
     */
    public static final int ORDER_CALLBACK_STATUS_SUCCESS = 0;
    /**
     * 订单回调状态-取消
     */
    public static final int ORDER_CALLBACK_STATUS_CANCEL = 1;
    /**
     * 订单回调状态-下单
     */
    public static final int ORDER_CALLBACK_STATUS_BUY = 2;

    /**
     * 推荐购药是否成单-未成单：<code>DOCTOR_RECOM_NOT_BUY</code>
     */
    public static final int DOCTOR_RECOM_NOT_BUY = 0;
    /**
     * 推荐购药是否成单-已成单：<code>DOCTOR_RECOM_ALREADY_BUY</code>
     */
    public static final int DOCTOR_RECOM_ALREADY_BUY = 1;

    /**
     * 商务代表订单类型-推荐用药
     */
    public static final int BS_ORDER_TYPE_COMM_BUY = 1;
    /**
     * 商务代表订单类型-主动购药
     */
    public static final int BS_ORDER_TYPE_ACTIVE_BUY = 2;
    /**
     * 消息任务ID-积分
     */
    public static final String MESSAGE_TASK_ID_POINT = "1";
    /**
     * redis key:医生状态获取,该key有cms维护，患者端也使用
     */
    public static final String DOCTOR_ACCOUNT_KEY = "naiteruipatiert|disdoctor.";
    public static final String DOCTOR_STATUS_KEY = "status";
    /**
     * redis key:注册，获取短信验证码
     */
    public static final String PHONE_REGIST_KEY = CommonConstant.REDIS_PRE_DR + "ph_rg_";
    /**
     * redis key:忘记密码，获取短信验证码
     */
    public static final String PHONE_FORGET_KEY = CommonConstant.REDIS_PRE_DR + "ph_fg_";
    /**
     * redis key:修改手机，获取短信验证码
     */
    public static final String PHONE_MODIFY_PHONE_KEY = CommonConstant.REDIS_PRE_DR + "ph_myph_";
    /**
     * redis key:修改密码，获取短信验证码
     */
    public static final String PHONE_MODIFY_PWD_KEY = CommonConstant.REDIS_PRE_DR + "ph_mypwd_";
    /**
     * redis key:登录验证码，获取短信验证码
     */
    public static final String PHONE_LOGIN_PWD_KEY = CommonConstant.REDIS_PRE_DR + "ph_login_";
    /**
     * redis key:小程序验证码，获取短信验证码
     */
    public static final String PHONE_MINI_PROGRAM_KEY = CommonConstant.REDIS_PRE_DR + "ph_miniprogram_";
    /**
     * 注册短信验证通过key
     */
    public static final String PHONE_VALID_REGIST_KEY = CommonConstant.REDIS_PRE_DR + "regist_verfiy_";
    /**
     * 忘记密码短信验证通过key
     */
    public static final String PHONE_VALID_FORGET_KEY = CommonConstant.REDIS_PRE_DR + "forget_verfiy_";
    /**
     * 电子签名设置密码短信验证通过key
     */
    public static final String PHONE_ESIGN_PWD_KEY = CommonConstant.REDIS_PRE_DR + "ph_esign_pwd";

    /**
     * redis key:注册，短信发送时间记录，用户60秒间隔控制
     */
    public static final String PHONE_SEND_TIME_KEY = CommonConstant.REDIS_PRE_DR + "ph_send_";
    /**
     * redis key:注册，短信发送时间记录，用户每天10条发送量控制
     */
    public static final String PHONE_SEND_COUNT_KEY = CommonConstant.REDIS_PRE_DR + "ph_count_";
    /**
     * redis key:注册，短信发送当天时间记录，用于限制用户每天10条发送量控制
     */
    public static final String PHONE_DAY_SEND_COUNT_KEY = CommonConstant.REDIS_PRE_DR + "ph_day_count_";
    /**
     * redis key:登陆私钥的loginKey
     */
    public static final String DOCTOR_LOGIN_KEY = CommonConstant.REDIS_PRE_DR + "loginKey_";
    /**
     * redis key:登陆成功的token key
     */
    public static final String DOCTOR_LOGIN_TOKEN_KEY = CommonConstant.REDIS_PRE_DR + "login_token_";
    /**
     * 电子签名设置密码状态
     */
    public static final String DOCTOR_ESIGN_PWD_STATUS_KEY = CommonConstant.REDIS_PRE_DR + "esign_pwd_staus_";
    /**
     * redis key:新增粉丝数，该key由患者端提供
     */
    public static final String INDEX_FAN_KEY = CommonConstant.REDIS_PRE_PT + "doctor_new_fans_";
    /**
     * redis key:新增好评数，该key由患者端提供
     */
    public static final String INDEX_PRAISE_KEY = CommonConstant.REDIS_PRE_PT + "doctor_new_praise_";
    /**
     * redis key:新增粉丝数查看，标识是否查看
     */
    public static final String INDEX_FAN_SEE_KEY = CommonConstant.REDIS_PRE_DR + "see_fans_";
    /**
     * redis key:新增好评数查看，标识是否查看
     */
    public static final String INDEX_PRAISE_SEE_KEY = CommonConstant.REDIS_PRE_DR + "see_praise_";
    /**
     * redis key:昨日新增积分
     */
    public static final String INDEX_ADD_POINT_KEY = CommonConstant.REDIS_PRE_DR + "new_point_";
    /**
     * redis key:周统计信息
     */
    public static final String INDEX_WEEK_COUNT_KEY = CommonConstant.REDIS_PRE_DR + "wek_count_";
    /**
     * redis key:医生绑定患者id集合
     */
    public static final String DOCTOR_PATIENT_LIST_KEY = CommonConstant.REDIS_PRE_DR + "psn_patient_";
    /**
     * redis key:医生abc患者列表集合
     */
    public static final String DOCTOR_PATIENT_ABC_KEY = CommonConstant.REDIS_PRE_DR + "abc_patient_";
    /**
     * redis key:search患者列表
     */
    public static final String DOCTOR_PATIENT_SEARCH_KEY = CommonConstant.REDIS_PRE_DR + "sch_patient_";
    /**
     * redis key:医生发展患者二维码key
     */
    public static final String SPREAD_PT_URL_KEY = CommonConstant.REDIS_PRE_DR + "pt_code_";
    /**
     * redis key:医生发展患者二维码key(微信小程序)
     */
    public static final String SPREAD_PT_WXA_URL_KEY = CommonConstant.REDIS_PRE_DR + "pt_code_wxa_";

    /**
     * 常用药添加数
     */
    public static final String MEDIC_COMMON_ADD_NUM = CommonConstant.REDIS_PRE_DR + "medic_common_add_num_";
    /**
     * pa(私人助理)消息推送记录key
     */
    public static final String PA_CHECK_KEY = CommonConstant.REDIS_PRE_DR + "pa_";
    /**
     * pa(私人助理)消息上次查看时间key
     */
    public static final String PA_SEE_CHECK_KEY = CommonConstant.REDIS_PRE_DR + "pa_see_";
    /**
     * pa(私人助理)消息模板key
     */
    public static final String PA_TEMPLATE_KEY = CommonConstant.REDIS_PRE_DR + "temp_";
    /**
     * 设备号前缀
     */
    public static final String DR_DSN = CommonConstant.REDIS_PRE_DR + "device_sn_";
    /**
     * 缓存-患者姓名
     */
    public static final String RDS_DR_PA_NAME = CommonConstant.REDIS_PRE_DR + "pa_name_";
    /**
     * 推荐用药活动redis key
     */
    public static final String RDS_DR_RECOM = CommonConstant.REDIS_PRE_DR + "recom_";
    /**
     * 待系统自动处理 会话_求药单 缓存：<code>IM_REQUIRE_ACTION</code>
     */
    public static final String IM_REQUIRE_ACTION = "naiterui_im|require_action_";

    public static final String RDS_REMIND_PT_RECORD = CommonConstant.REDIS_PRE_DR + "remind_pt_record_";

    /**
     * 三方API用量统计redis key前缀
     */
    public static final String RDS_OPEN_API_REACHED = CommonConstant.REDIS_PRE_DR + "open_api_reached_";

    /**
     * 应用版本信息缓存key
     */
    public static final String RDS_APP_VERSION_KEY = CommonConstant.REDIS_PRE_DR + "app_version_";

    /**
     * 腾讯人脸实名
     */
    public static final String RDS_DETECT = CommonConstant.REDIS_PRE_DR + "detect_";

    /**
     * 四川监管对接access_token缓存key
     */
    public static final String SUPERVISE_ACCESS_TOKEN_KEY = "supervise_access_token";

    /**
     * 人脸实名认证操作标记 key
     */
    public static final String RDS_REALNAME_AUTH_STATUS_CACHE = PropertyValueConstants.RDS_DETECT + "realname_auth_status_";

    /**
     * 医生好评总分数 key
     */
    public static final String RDS_CONSULT_COMMENT_APPLAUSE_SCORE = CommonConstant.REDIS_PRE_DR + "consult_comment_applause_score_";

    /**
     * 医生评价总分数 key
     */
    public static final String RDS_CONSULT_COMMENT_TOTAL_SCORE = CommonConstant.REDIS_PRE_DR + "consult_comment_total_score_";

    /**
     * redis key:快捷登录状态key
     */
    public static final String FAST_LOGIN_STATUS_CACHE = CommonConstant.REDIS_PRE_DR + "fast_login_status_";

    public static final boolean getRdsRealnameAuthStatus(Long doctorId) {
        return RedisUtils.existsKey(RDS_REALNAME_AUTH_STATUS_CACHE + doctorId);
    }

    public static final void setRdsRealnameAuthStatus(Long doctorId) {
        RedisUtils.set(RDS_REALNAME_AUTH_STATUS_CACHE + doctorId, 1, 10 * 60);
    }

    public static final void removeRdsRealnameAuthStatus(Long doctorId) {
        RedisUtils.delete(RDS_REALNAME_AUTH_STATUS_CACHE + doctorId);
    }

    /**
     * 三方API用量统计redis key
     *
     * @param appId
     * @param apiId
     * @param success
     *
     * @return
     */
    public static final String getRdsKeyByOpenApiReached(Integer appId, String apiId, boolean success) {
        String date = DateUtil.getCurrentFormatDate();
        String type = success ? "success" : "error";
        return RDS_OPEN_API_REACHED + date + "_" + appId + "_" + apiId + "_" + type;
    }

    // 医生出诊时间//
    public static final int WEEK_1 = 1;
    public static final int WEEK_2 = 2;
    public static final int WEEK_3 = 3;
    public static final int WEEK_4 = 4;
    public static final int WEEK_5 = 5;
    public static final int WEEK_6 = 6;
    public static final int WEEK_7 = 7;
    public static final Map<Integer, String> WEEKS;
    /**
     * 分页批量处理，每页10000：<code>DOCTOR_VIDEO_RESERVE_INFO_PAGENUM</code>
     */
    public static final int DOCTOR_VIDEO_RESERVE_INFO_PAGENUM = 10000;
    public static final String AM = "上午";
    public static final String PM = "下午";
    public static final String NIGHT = "晚上";

    /**
     * 私人助理消息已改版为系统消息（中间还叫过账户动态），业务需求已有较大变更，需要重新设计。TODO：
     **/
    // 私人助理模板类型
    public static final int TEMPLATE_TYPE_REGIST = 1;// 1:注册
    public static final int TEMPLATE_TYPE_AUTH_APPLY = 2;// 2:提交认证资料
    public static final int TEMPLATE_TYPE_AUTH_SUCCESS = 3;// 3:认证通过
    public static final int TEMPLATE_TYPE_AUTH_FALD = 4;// 4:认证失败

    public static final int TEMPLATE_TYPE_AUTH_NEW_SUCCESS = 2;// 认证状态：2:已通过
    public static final int TEMPLATE_TYPE_AUTH_NEW_FAIL = 3;// 认证状态：3：b不通过

    public static final int TEMPLATE_TYPE_POINT_CS_SUCCESS = 5;// 5:客服审核通过(取消发送消息)
    public static final int TEMPLATE_TYPE_POINT_FINANCE_SUCCESS = 6;// 6:财务审核通过
    public static final int TEMPLATE_TYPE_POINT_CS_FALD = 7;// 7:客服审核失败
    public static final int TEMPLATE_TYPE_POINT_FINANCE_FALD = 8;// 8:财务审核失败
    public static final int TEMPLATE_TYPE_ACOUNT_MODIFY = 9;// 9资金变动
    /**
     * 备案通过：<code>TYPE_RECORD_SUCCESS</code>
     */
    public static final int TEMPLATE_TYPE_RECORD_SUCCESS = 10;
    /**
     * 备案失败：<code>TYPE_RECORD_FAIL</code>
     */
    public static final int TEMPLATE_TYPE_RECORD_FAIL = 11;
    /**
     * 要求备案：<code>TYPE_RECORD_REQUIRED</code>
     */
    public static final int TEMPLATE_TYPE_RECORD_REQUIRED = 12;
    /**
     * 部分购买通知文案
     */
    public static final int TEMPLATE_TYPE_RECOMMEND_PARTBUY = 13;
    /**
     * 全部购买通知文案
     */
    public static final int TEMPLATE_TYPE_RECOMMEND_ALLBUY = 14;
    /**
     * 取消购买通知文案
     */
    public static final int TEMPLATE_TYPE_RECOMMEND_CANCELBUY = 15;

    /**
     * 用药提醒通知
     */
    public static final int TEMPLATE_TYPE_MEDICATION_REMIND = 18;

    /**
     * 不需要备案
     */
    public static final int TEMPLATE_TYPE_RECORD_STATUS_NO = 19;

    /**
     * 复诊提醒to医生 ReferralNotice
     */
    public static final int TEMPLATE_TYPE_REFERRALNOTICE = 20;

    /**
     * 获得cdss使用权，通知邀请医生
     */
    public static final int TEMPLATE_TYPE_CDSS_NOTIFY_INVITER = 21;

    /**
     * 获得cdss永久使用权，通知邀请医生
     */
    public static final int TEMPLATE_TYPE_CDSS_NOTIFY_INVITER_FOREVER = 22;

    /**
     * 获得cdss使用权，通知被邀请医生
     */
    public static final int TEMPLATE_TYPE_CDSS_NOTIFY_INVITEE = 23;

    /**
     * 病例收集邀请发送邀请通知
     */
    public static final int TEMPLATE_TYPE_CASE_COLLECT_INVITE_NOTIFY = 24;

    /**
     * 病例收集成功，发送通知
     */
    public static final int TEMPLATE_TYPE_CASE_COLLECT_SUCCESS_NOTIFY = 25;

    /**
     * 病例收集失败，发送通知
     */
    public static final int TEMPLATE_TYPE_CASE_COLLECT_FAILURE_NOTIFY = 26;

    /**
     * 线上诊室退费，发通知
     */
    public static final int TEMPLATE_TYPE_CONSULT_ROOM_RETURNS = 27;

    /**
     * 会话评价，发通知
     */
    public static final int TEMPLATE_TYPE_CONSULT_COMMENT_NOTIFY = 28;

    /**
     * 医生备案结果状态--通过
     */
    public static final int TEMPLATE_TYPE_RECORD_RESULTS_SUCCESS = 30;

    /**
     * 医生备案结果状态--识别
     */
    public static final int TEMPLATE_TYPE_RECORD_RESULTS_FAIL = 31;

    /**
     * 随访管理，发通知
     */
    public static final int TEMPLATE_TYPE_FOLLOW_UP_NOTIFY = 32;


    /**
     * 医生宣教未读公共
     */
    public static final String EDU_UNREAD_SIGN = CommonConstant.REDIS_PRE_DR + "edu_unread_sign|";

    /**
     * 新增宣教标识
     */
    public static final int EDU_DR_ALL = 3;

    /**
     * 阳光化订单患者购药APP通知短消息map</p>
     * key:系统通知类型，value：notice短消息</p>：<code>RECORD_NOTICE_SHORT_MSG_MAP</code>
     */
    public static final Map<Integer, String> RECORD_BUY_NOTICE_MSG_MAP;

    static {
        Map<Integer, String> buyMsg = new HashMap<>();
        buyMsg.put(TEMPLATE_TYPE_RECOMMEND_ALLBUY, "成功购买药品通知");
        buyMsg.put(TEMPLATE_TYPE_RECOMMEND_CANCELBUY, "取消购药订单通知");
        RECORD_BUY_NOTICE_MSG_MAP = Collections.unmodifiableMap(buyMsg);
    }

    /**
     * 认证状态变更系统通知push文案MAP</p>
     * key:通知类型，value：push文案</p> ：<code>AUTH_PUSH_MSG_MAP</code>
     */
    public static final Map<Integer, String> AUTH_PUSH_MSG_MAP;

    static {
        Map<Integer, String> pushMsg = new HashMap<>();
        pushMsg.put(TEMPLATE_TYPE_AUTH_NEW_FAIL, "很抱歉，您的身份认证审核没有通过，原因如下：{0}");
        pushMsg.put(TEMPLATE_TYPE_AUTH_NEW_SUCCESS, "恭喜您，您的医师身份认证已通过！");
        AUTH_PUSH_MSG_MAP = Collections.unmodifiableMap(pushMsg);
    }

    /**
     * 备案状态变更系统通知push文案MAP，(与系统通知文案不一致)</p>
     * key:系统通知类型，value：push文案</p> ：<code>RECORD_NOTICE_PUSH_MSG_MAP</code>
     */
    public static final Map<Integer, String> RECORD_PUSH_MSG_MAP;

    static {
        Map<Integer, String> pushMsg = new HashMap<>();
        pushMsg.put(TEMPLATE_TYPE_RECORD_SUCCESS, "恭喜您互联网医院已经备案成功！平台为您预置了诊费：图文120元/次；视频150元/次。");
        pushMsg.put(TEMPLATE_TYPE_RECORD_FAIL, "很抱歉，您的互联网医院备案申请没有通过，原因如下：{0}");
        pushMsg.put(TEMPLATE_TYPE_RECORD_REQUIRED, "根据卫健委要求，也是为了保障您的处方行为真实有效，请提交互联网医院备案资料");
        pushMsg.put(TEMPLATE_TYPE_RECORD_STATUS_NO, "您好，根据卫健委要求，您暂时不需要进行互联网医院备案，谢谢");
        RECORD_PUSH_MSG_MAP = Collections.unmodifiableMap(pushMsg);
    }

    /**
     * 备案状态变更APP通知短消息map</p>
     * key:系统通知类型，value：notice短消息</p>：<code>RECORD_NOTICE_SHORT_MSG_MAP</code>
     */
    public static final Map<Integer, String> RECORD_NOTICE_MSG_MAP;

    static {
        Map<Integer, String> pushMsg = new HashMap<>();
        pushMsg.put(TEMPLATE_TYPE_RECORD_SUCCESS, "恭喜您，您的医师身份认证已通过！平台为您预置了问诊费：图文咨询120/次；视频问诊150/次");
        pushMsg.put(TEMPLATE_TYPE_RECORD_FAIL, "很抱歉，您的身份认证审核没有通过，原因如下：{0}，请提交真实有效的信息，感谢您的支持");
        pushMsg.put(TEMPLATE_TYPE_RECORD_REQUIRED, "根据卫健委要求，请提交备案");
        pushMsg.put(TEMPLATE_TYPE_RECORD_STATUS_NO, "您好，根据卫健委要求，您暂时不需要进行互联网医院备案，谢谢");
        RECORD_NOTICE_MSG_MAP = Collections.unmodifiableMap(pushMsg);
    }

    /** 备案状态变更账户动态相关，临时方案，待优化 TODO： **/

    /**
     * app分享医生-医生二维码
     */
    public static final int APP_DOCTOR_2_DOCTOR_TYPE = 100;
    /**
     * app分享医生-患者二维码
     */
    public static final int APP_DOCTOR_2_PATIENT_TYPE = 200;
    /**
     * 地区类型-市
     */
    public static final int AREA_TYPE_CITY = 2;
    public static final int DR_PATIENT_REMARKNAME_LENGTH_MAX = 19;// 患者备注名允许的最大长度
    /**
     * 供b2c调用接口加密key，无需配置文件，不会更改，要改双方都得改：<code>B2C_SIGN_KEY</code>
     */
    public static final String B2C_SIGN_KEY = "KDHh53CRApi1N6SB3QuErw7FWj3eaW";
    // 患者账号状态
    public static final int PATIENT_ACCOUNT_STATUS_OK = 0;// 正常
    public static final int PATIENT_ACCOUNT_STATUS_DISABLED = 1;// 禁用
    /**
     * 删除个人数据(擅长)
     */
    public static final int DOCTOR_DEL_TYPE_EXPERTISE = 1;
    /**
     * 删除个人数据 (简介)
     */
    public static final int DOCTOR_DEL_TYPE_INTRODUCTION = 2;
    /**
     * 银行卡用户类型-医生
     */
    public static final int CARD_USER_TYPE_DR = 1;
    /**
     * 账户收支类型-收入
     */
    public static final int ACC_CHANGE_TYPE_IN = 0;
    /**
     * 账户收支类型-支出
     */
    public static final int ACC_CHANGE_TYPE_OUT = 1;
    /**
     * 账户变更类型-主账户
     */
    public static final int ACC_CHANGE_CATE_MAIN = 1;
    /**
     * 最低提现额
     */
    public static final int MIN_WITHDRAWAL = 300 * 100;
    /**
     * 首单五折活动区间开始、结束发送push任务记录缓存key
     */
    public static final String ACTIVITIES_FIRST_ORDER_SEND_PUSH = CommonConstant.REDIS_PRE_DR + "activities_first_order_push_";
    /**
     * 首次登陆后72小时未认证缓存key
     */
    public static final String DOCTOR_AUDIT_REMIND_CACHE = CommonConstant.REDIS_PRE_DR + "doctor_audit_map";
    /**
     * 系统客服患者KEY
     */
    public static final String SYS_KF_PATIENT_KEY = "sys.kf.patientId";
    /**
     * redis key :互联网(结算)医院列表
     */
    public static final String RDS_KEY_EHOSPITAL_LIST = CommonConstant.REDIS_PRE_EHOSPITAL + "eHospital_list";
    /*
     * 医院等级
     */
    public static final int HOSPITAL_LEVEL_THREE_TOP = 7;// 三级特等
    public static final int HOSPITAL_LEVEL_THREE_GRADE_A = 8;// 三级甲等
    public static final int HOSPITAL_LEVEL_THREE_GRADE_B = 9;// 三级乙等
    public static final int HOSPITAL_LEVEL_THREE_GRADE_C = 10;// 三级丙等
    public static final int HOSPITAL_LEVEL_TWO_GRADE_A = 4;// 二级甲等
    public static final int HOSPITAL_LEVEL_TWO_GRADE_B = 5;// 二级乙等
    public static final int HOSPITAL_LEVEL_TWO_GRADE_C = 6;// 二级丙等
    public static final int HOSPITAL_LEVEL_ONE_GRADE_A = 1;// 一级甲等
    public static final int HOSPITAL_LEVEL_ONE_GRADE_B = 2;// 一级乙等
    public static final int HOSPITAL_LEVEL_ONE_GRADE_C = 3;// 一级丙等
    public static final int HOSPITAL_LEVEL_GRADE_DEFALT = 0;// 无等级
    public static final int[] HOSPITAL_LEVEL_SEQUENCES = {7, 8, 9, 10, 4, 5, 6, 1, 2, 3, 0};// 等级顺序
    /**
     * 视频服务最低有效时长配置key，单位：分钟：<code>VIDEO_SERVICE_EFFECTIVE_PERIOD_KEY</code>
     */
    public static final String VIDEO_SERVICE_EFFECTIVE_PERIOD_KEY = "video.service.effective.period";
    /**
     * 视频服务默认可选收费配置配置key，单位：分：<code>VIDEO_SERVICE_DEFAULT_CHARGES_KEY</code>
     */
    public static final String VIDEO_SERVICE_DEFAULT_CHARGES_KEY = "video.service.default.charges";
    /**
     * 视频收费单位描述：<code>VIDEO_SERVICE_UNIT_DESC</code>
     */
    public static final String VIDEO_SERVICE_CHARGE_UNIT_DESC = "video.service.charge.unit.desc";
    /**
     * 最小申请积分
     */
    public static final int MIN_APPLY_POINT = 2000;
    /**
     * 申请提现状态-隐藏
     */
    public static final int APPLY_STATUS_HIDDEN = 0;
    /**
     * 申请提现状态-展示
     */
    public static final int APPLY_STATUS_SHOW = 1;
    /**
     * 申请提现状态-不可提现
     */
    public static final int APPLY_STATUS_NOT_ALLOW = 2;

    /************* 收费服务相关 *************/
    /**
     * 推荐有效期-7天
     */
    public static final long MEDICATION_RECOM_EXPIRATION = 7 * 24 * 60 * 60 * 1000;
    // 设置微信登陆医生已禁用是否通知
    public static String DOCTOR_WX_LOGIN_FORBIDDEN = CommonConstant.REDIS_PRE_DR + "login_wx_fb";
    // 验证码错误规则的redis key
    public static final String VALID_KEY = CommonConstant.REDIS_PRE_DR + "valid_exp";
    // 验证码错误规则的redis key的count字段以及默认值
    public static final String VALID_COUNT_FIELD = "count";
    public static final int DEFAULT_COUNT_FIELD = 20;
    // 验证码错误规则的redis key的time字段以及默认值
    public static final String VALID_TIME_FIELD = "time";
    public static final int DEFAULT_TIME_FIELD = 10 * 60;

    /**
     * 显示小七指数或市场积分：0.不显示,1.显示小七指数,2.显示市场积分 ,3.显示病历数据收集
     */
    public static final int SHOW_COMMISSION_NO = 0;
    /**
     * 显示小七指数或市场积分：0.不显示,1.显示小七指数,2.显示市场积分 ,3.显示病历数据收集
     */
    public static final int SHOW_COMMISSION_RATE = 1;
    /**
     * 显示小七指数或市场积分：0.不显示,1.显示小七指数,2.显示市场积分 ,3.显示病历数据收集
     */
    public static final int SHOW_COMMISSION_MARKET_POINT = 2;
    /**
     * 显示小七指数或市场积分：0.不显示,1.显示小七指数,2.显示市场积分 ,3.显示病历数据收集
     */
    public static final int SHOW_COMMISSION_COLLECT_DATA = 3;

    /**
     * 病历数据收集邀请通知状态：1.未超时失效， 2.已超时失效
     **/
    //稍后迁移到公共常量类ehp-constans
    public static final Integer COLLECT_MESSAGE_TIMEOUT_NO = 1; //通知未超时

    public static final Integer COLLECT_MESSAGE_TIMEOUT_YES = 2;  //通知已超时

    static {
        Map<Integer, String> weeks = new HashMap<>();
        weeks.put(WEEK_1, "周一");
        weeks.put(WEEK_2, "周二");
        weeks.put(WEEK_3, "周三");
        weeks.put(WEEK_4, "周四");
        weeks.put(WEEK_5, "周五");
        weeks.put(WEEK_6, "周六");
        weeks.put(WEEK_7, "周日");
        WEEKS = Collections.unmodifiableMap(weeks);
    }

    /**
     * 用药随访，随访记录编号前缀
     */
    public static final String DR_VISIT_SERIAL_PRE = "F";

    /**
     * 默认群发消息模板
     **/
    public static final String BATCH_MESSAGE_DEFAULT_MSG = "batch.message.default.msg";
    /**
     * 禁止发送消息文案
     **/
    public static final String BATCH_MESSAGE_RED_MSG = "batch.message.red.msg";
    /**
     * 允许发送消息文案
     **/
    public static final String BATCH_MESSAGE_GREEN_MSG = "batch.message.green.msg";
    /**
     * 一天可以发总消息
     **/
    public static final String BATHC_MEESAGE_TOTAL_NUM = "bathc.meesage.total.num";
    /**
     * 群发消息地址
     **/
    public static final String BATCH_MESSAGE_SEND_URL = "batch.message.send.url";
    /**
     * 添加搜索数据地址
     **/
    public static final String RECORD_INDEX_ADD_URL = "record.index.add.url";
    /**
     * 添加病历数据地址
     **/
    public static final String RECORD_ADD_URL = "record.add.url";
    /**
     * 查询索引数据地址
     **/
    public static final String RECORD_INDEX_QEURY_URL = "record.index.qeury.url";
    /**
     * 查询病历诊疗数据地址
     **/
    public static final String RECORD_QEURY_URL = "record.qeury.url";
    /**
     * 更新索引数据地址
     **/
    public static final String RECORD_INDEX_UPDATE_URL = "record.index.update.url";
    /**
     * 更新病历数据地址
     */
    public static final String RECORD_UPDATE_URL = "record.update.url";
    /**
     * 医生诊疗记录key
     */
    public static final String DR_RECORD_KEY = "dr_record_ky";
    /**
     * 处方诊疗记录key
     */
    public static final String SYS_PRESCRIPTION_RECORD_KEY = "sys_prescription_record_key";
    /**
     * 所有数据
     */
    public static final Integer ALL = 1;
    /**
     * 医生数据
     */
    public static final Integer DR = 0;
    /**
     * 默认处方图片地址
     */
    public static final String DEFAULT_PRESCRIPTION_IMG_URL = "prescription.img.url";

    /************* 收费服务相关 *************/

    /**
     * redis key : 医生端首页banner数据缓存 默认 15min
     */
    public static String getDoctorBannerCache(Long doctorId) {
        return CommonConstant.REDIS_PRE_DR + "bannerInfo_" + doctorId;
    }

    /**
     * redis key : 医生端首页浮动层数据缓存 默认 15min
     */
    public static String getDoctorLayerCache(Long doctorId) {
        return CommonConstant.REDIS_PRE_DR + "layerInfo_" + doctorId;
    }

    /**
     * redis key : 医生端药瓶赠率数据缓存 默认 15min
     */
    public static String getGoodsRateCache(Long skuId) {
        return CommonConstant.REDIS_PRE_DR + "goodsRates_" + skuId.toString();
    }

    /**
     * redis key : 商务代表合作方数据缓存 默认 不限时
     */
    public static String getPartnerCache(Long partnerId) {
        return CommonConstant.REDIS_PRE_DR + "bs_partner_" + partnerId.toString();
    }

    /**
     * redis key : 医生推荐记录-用药详情的药品提成比例 不限时
     */
    public static String getDrCommissionCache(Long skuId, Long recomId) {
        return CommonConstant.REDIS_PRE_DR + "dr_Commission_" + recomId.toString() + skuId.toString();
    }

    /**
     * redis key : 医生推荐记录-用药详情的药品提成比例 不限时
     */
    public static String getRequireCacheKey(String sessionId, Long requireId) {
        return IM_REQUIRE_ACTION + sessionId + "_" + requireId;
    }

    /**
     * redis key : 首单五折发送push缓存记录key
     */
    public static String getActivitiesFirstOrderPushKey(String sendTime, Integer type) {
        return ACTIVITIES_FIRST_ORDER_SEND_PUSH + type + "_" + sendTime;
    }

    /**
     * redis key : 根据患者unionId获取上级医生Id所在区域
     */
    public static String getPatientUpDoctorIdCache(String unionId) {
        return CommonConstant.REDIS_PRE_DR + "patient_doctor_" + unionId;
    }

    /**
     * redis key : 根据医生Id获取医生所在区域
     */
    public static String getDoctorAreaCache(Long id) {
        return CommonConstant.REDIS_PRE_DR + "doctor_area_" + id;
    }

    /**
     * redis key : 根据活动ID获取首单五折活动数
     */
    public static String getActRecomCountKey(String actId) {
        return CommonConstant.REDIS_PRE_DR + "recom_count_" + actId;
    }

    /**
     * redis key : 一键签到请求锁
     */
    public static String getOneKeySignRequestLockKey(Long doctorId) {
        return CommonConstant.REDIS_PRE_DR + "one_key_sign_request_lock_" + doctorId;
    }

    /**
     * 根据性别编号获取性别描述
     * PropertyValueConstants.genderName()
     *
     * @param gender
     *
     * @return
     *
     * @Author guoyongxiang
     * @Date 2017年2月16日
     * @since 1.0.0
     */
    public static String genderName(Integer gender) {
        if (gender != null) {
            if (gender == 0) {
                return "女";
            } else if (gender == 1) {
                return "男";
            }
        }
        return "未知";
    }

    /**
     * redis key：获取短信验证错误后的操作key
     */
    public static String getSmsValidUserOperatorKey(String cacheKey) {
        return cacheKey + "|key";
    }

    /**
     * redis key : 宣教发送次数
     */
    public static String getEduSendCountKey(Long doctorId) {
        return CommonConstant.REDIS_PRE_DR + "edu_send_count|" + doctorId;
    }

    /**
     * redis key : 宣教未读标识[2.16新增]
     */
    public static String getEduUnreadSignKey(int type, String id) {
        if (EDU_DR_ALL == type) {
            return EDU_UNREAD_SIGN + type;
        }
        return EDU_UNREAD_SIGN + type + "|" + id;
    }

    /**
     * redis key : 医生宣教已读存储时间戳
     */
    public static String getEduDoctorKey(long doctorId) {
        return EDU_UNREAD_SIGN + "doctor_read|" + doctorId;
    }

    /**
     * 签到REDIS锁key
     */
    public static String getSignRedisLockKey(Long doctorId, String signDate) {
        return "DOCTOR_SIGN_" + doctorId + "_" + signDate;
    }

    /**
     * redis key登陆失败计数
     */
    public static String getLoginFailKey(Long loginId) {
        return CommonConstant.REDIS_PRE_DR + "login_fail_count|" + loginId;
    }

    /**
     * redis key 实名认证开关
     */
    public static String RDS_KEY_USER_AUTH_SWITCH = CommonConstant.REDIS_PRE_DR + "user_auth_switch";

    /**
     * redis key 实名认证限制次数
     */
    public static String RDS_KEY_USER_AUTH_LIMIT = CommonConstant.REDIS_PRE_DR + "user_auth_limit";
}
